package cn.antscrpt.antLib.logo 
{
	import flash.geom.Point;
	import org.papervision3d.core.geom.renderables.Triangle3D;
	import org.papervision3d.core.geom.renderables.Vertex3D;
	import org.papervision3d.core.geom.TriangleMesh3D;
	import org.papervision3d.core.proto.MaterialObject3D;
	
	/**
	 * ...
	 * @author AntScript
     * @blog  http://www.antscript.cn
	 */
	public class CustomTriangle extends TriangleMesh3D
	{
		
		public function CustomTriangle(myMaterial:MaterialObject3D,points:Vector.<Number>) 
		{
			if (points.length >= 6) {
				
				var vertex3D_1:Vertex3D = new Vertex3D(points[0], points[1], 0);
				var vertex3D_2:Vertex3D = new Vertex3D(points[2], points[3], 0);
				var vertex3D_3:Vertex3D = new Vertex3D(points[4], points[5], 0);
				
				var triangleVertices:Array = [vertex3D_1, vertex3D_2, vertex3D_3];
				
				var triangle3d:Triangle3D = new Triangle3D(null, triangleVertices, myMaterial);
				var triangleFaces:Array = [triangle3d];
				
				var triangleMesh3d:TriangleMesh3D = new TriangleMesh3D(material, triangleVertices, triangleFaces, null);				
				
				super(myMaterial, triangleVertices, triangleFaces, null);
				
				triangle3d.instance = this;
			}			
			
 
		}
		
	}
	
}